<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/fileupload.js"></script>
    <script src="My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" href="css/img.css">
    <script>
        function fenye(cpage) {
            $("[name='cpage']").val(cpage);
            $("form").submit();
        }
        function toadd() {
            location="toadd.do";
        }
        function del(cid) {
            $.ajax({
                       url:"del.do",
                       type:"post",
                       data:{"cid":cid},
                       dataType:"json",
                       success:function(obj) {
                                if (obj>0){
                                    alert("删除成功");
                                    location="list.do";
                                }
                       }
                  })
        }
        $(function () {
            $.ajax({
                       url:"cityList.do",
                       type:"post",
                       data:{"pid":0},
                       dataType:"json",
                       success:function(obj) {
                            for (var i in obj){
                                $("[name='sheng']").append("<option value='"+obj[i].id+"'>"+obj[i].cname)
                            }
                       }
                  })
                $("[name='sheng']").change(function () {
                    var pi = $(this).val();
                    $("[name='shi']").empty()
                    $("[name='shi']").append("<option value=''>请选择</option>")
                    $("[name='xian']").empty();
                    $("[name='xian']").append("<option value=''>请选择</option>")
                    $.ajax({
                               url:"cityList.do",
                               type:"post",
                               data:{"pid":pid},
                               dataType:"json",
                               success:function(obj) {

                               }
                          })
                })
            $("[name='shi']").change(function () {
                var pid = $(this).val();
                $("[name='xian']").empty();
                $("[name='xian']").append("<option value=''>请选择</option>")
                $.ajax({
                           url:"cityList.do",
                           type:"post",
                           data:{"pid":pid},
                           dataType:"json",
                           success:function(obj) {
                                $("[name='xian']").append("<option value='"+obj[i].id+"'>"+obj[i].name+"</option>")
                           }
                      })      
            })
        })
        $(function () {
            var cid = $(this).cid
            $.ajax({
                       url:"getIfnoByCid.do",
                       type:"post",
                       data:{"cid":$("[name='cid']").val()},
                       dataType:"json",
                       success:function(obj) {
                            $("[name='cname']").val(obj.cname);
                       }
                  })
        })
    </script>
</head>
<body>
<form action="list.do" method="post">
    <input type="hidden" name="cpage">
    时间:<input type="text" name="opentimeX" value="${map.opentimeX}">~~
        <input type="text" name="opentimeD" value="${map.opentimeD}">
    <input type="submit" value="查询">
</form>
<table border="1">
    <tr>
        <td>编号</td>
        <td>名称</td>
        <td>时间</td>
        <td>图片</td>
        <td>地域</td>
        <td>籍贯</td>
    </tr>
    <c:forEach items="${pageInfo.list}" var="c">
        <tr>
            <td></td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
